<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> 
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> 
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/translator.tld" prefix="trans" %>

<!-- flooble Expandable Content header start -->
<script language="javascript">
// Expandable content script from flooble.com.
// For more information please visit:
//   http://www.flooble.com/scripts/expand.php
// Copyright 2002 Animus Pactum Consulting Inc.
//----------------------------------------------
var ie4 = false; if(document.all) { ie4 = true; }
function getObject(id) { if (ie4) { return document.all[id]; } else { return document.getElementById(id); } }
function toggle(link, divId) { var lText = link.innerHTML; var d = getObject(divId);
 if (lText == '+') { link.innerHTML = '&#8722;'; d.style.display = 'block'; }
 else { link.innerHTML = '+'; d.style.display = 'none'; } }
</script>
<!-- flooble Expandable Content header end   -->


<trans:initPage module="search2" />



<table align="center" width="100%" cellspacing="1" cellpadding="4"
 border="0" background=<html:rewrite page="/images/pixelbgtable.gif"/> class="text_search">
<logic:empty name="results" scope="session">
<trans:showPageMessage label="no_results_found" />
</logic:empty>
<!--for each row-->
<logic:iterate scope="request" name="page_results" id="row" indexId="ridx">
<logic:equal name="ridx" value="0">
<tr bgcolor="#FFFFFF">
		
		<!--header generation-->
		<logic:iterate name="row" indexId="cidx" id="cell">
		<bean:define id="sIdx" name="row" property="sortIdx"/>
		<%if(cidx.equals(sIdx)) {
		%><th bgcolor="#F7F7F7" align="center"><%
		} else {
		%>
		<th class="text_search" align="center">
		<% } %>
		
				
		<html:link page="/search.do" paramId="sortby" paramName="cidx">
		<trans:showPageMessage>
			<bean:write name="cell" property="type"/>
		</trans:showPageMessage>
		</html:link>
		
		
		<%if(cidx.equals(sIdx)) {%>
		<logic:equal name="row" property="sortDesc" value="true">
		<html:img page="/images/adown.gif"/>
		</logic:equal>
		
		<logic:equal name="row" property="sortDesc" value="false">
		<html:img page="/images/aup.gif"/>		
		</logic:equal>
		<% } %>
		</th>
		</logic:iterate>


</tr>
</logic:equal>
<tr bgcolor="#FFFFFF">
	<!--we show each cell one by one-->
		<logic:iterate name="row" indexId="cidx" id="cell">
		<bean:define id="sIdx" name="row" property="sortIdx"/>
		
		<%if(cidx.equals(sIdx)) {
		%><td bgcolor="#F7F7F7" align="center"><%
		} else {
		%>
		<td class="text_search" align="center">
		<% } %>
			<logic:equal name="cell" property="list" value="true">
				
					<!-- flooble Expandable Content box start -->
					<div><table class="text_search"><tr><td align="left">
					
					-&nbsp;
				
				<logic:equal name="cidx" value="0">
					<html:link page="/activity/view.jsp" paramId="id" paramName="cell" paramProperty="projectId">
					<bean:write name="cell" property="firstItem" filter="false"/>
					</html:link>
				</logic:equal>
				
				<logic:notEqual name="cidx" value="0">
					<bean:write name="cell" property="firstItem" filter="false"/>
				</logic:notEqual>
					
					
					</td><td align="right">
					<font size="+1">
					<a  title="show/hide" id='<bean:write name="cell" property="uniqueId"/>_link' href="javascript: void(0);" onclick="toggle(this, '<bean:write name="cell" property="uniqueId"/>');"  class="text_boldblue">\u2212</a>
					</font>
					</td>
					</tr>
					<tr>
					<td colspan="2" align="left">
					<div id="<bean:write name="cell" property="uniqueId"/>">
					<bean:write name="cell" property="extraHTML" filter="false" />					
					</div>
					</td>
					</tr></table>
					</div><script language="javascript">toggle(getObject('<bean:write name="cell" property="uniqueId"/>_link'), '<bean:write name="cell" property="uniqueId"/>');</script>
				
				
			</logic:equal>
			<logic:notEqual name="cell" property="list" value="true">
			
				<logic:equal name="cidx" value="0">
					<html:link page="/activity/view.jsp" paramId="id" paramName="cell" paramProperty="projectId">
						<bean:write name="cell" filter="false"/>
					</html:link>
				</logic:equal>
				
				<logic:notEqual name="cidx" value="0">
						<bean:write name="cell" filter="false"/>
				</logic:notEqual>
			
			</logic:notEqual>
		</td>
		</logic:iterate>
</tr>
</logic:iterate>
</table>
<logic:present name="pagetk">
<table align="center" width="100%" cellspacing="1" cellpadding="4"
 border="0" background=<html:rewrite page="/images/pixelbgtable.gif"/> class="text_search">

<tr>
<td bgcolor="#FFFFFF" align="center">
<trans:showPageMessage label="pages" /> 
<logic:iterate scope="request" name="pagetk" id="token">
<html:link page="/search.do" name="token" property="params">
<bean:write name="token" property="no"/>
</html:link>
&nbsp;|&nbsp;
</logic:iterate>
</td>
</tr>
</table>

</logic:present>
<table align="center" width="100%" cellspacing="1" cellpadding="4"
 border="0" background=<html:rewrite page="/images/pixelbgtable.gif"/> class="text_search">

<tr bgcolor="#FFFFFF">
<logic:notEmpty name="results" scope="session">
<td align="center" width="30%">
<input type=button class=buton 
    onclick=javascript:window.location.href='<html:rewrite page="/search.do"/>?excel=y';
    value="<trans:showPageMessage label="excelexport" hide_link="true" />" />
</td>
</logic:notEmpty>
<td align="center" width="30%">
<input type=button class=buton 
    onclick=javascript:window.location.href='<html:rewrite page="/search.do"/>?newsearch=y';
    value="<trans:showPageMessage label="perform_another_search" hide_link="true" />" />

</td>
<td align="center" width="30%">
<input type=button class=buton 
    onclick=javascript:window.location.href='<html:rewrite page="/resultsFormat.do"/>?mode=list';
    value="<trans:showPageMessage label="editformats" hide_link="true" />" />
</td>

</tr>

<tr bgcolor="#FFFFFF">
<td align="center" colspan="3">
<logic:notEmpty name="results" scope="session">
<input type=button class=buton
    onclick=javascript:window.location.href='<html:rewrite page="/charts/wizzard.do"/>';
    value="<trans:showPageMessage label="chart.it" hide_link="true" />" />
</logic:notEmpty>

	<trans:showPageMessage label="translator.showhiddentags" />
</td>
</tr>

</table>
